
public class Rect {
// this file is just a copy from the book: we define a class that represents a rectangle;
public int x1,x2,y1,y2;

public Rect(int x1, int x2, int y1, int y2){
	//we construct the rectangle
	this.x1=x1;
	this.x2=x2;
	this.y1=y1;
	this.y2=y2;
}

public Rect(int width, int height){
	// another way to construct the rectangle
	this(0,0,width, height);
}
public void move(int delx, int dely){
	// we are moving the rectangle by delx, dely
	x1=x1+delx;
	x2=x2+delx;
	y1=y1+dely;
	y1=y2+dely;
}
public boolean isInside(int x, int y){
	// checking if the point x,y is inside our rectangle
	return((x>=x1)&&(x<=x2)&&(y>=y1)&&(y<=y2));
}
}
